package com.chj.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chj.dto.SelectOrderInfoDto;
import com.chj.entity.OrderItemEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface OrderItemEntityMapper  extends BaseMapper<OrderItemEntity> {

    @Select("select t1.order_num, t1.total_price, t1.user_num, t2.nick_name, t1.created_date, t1.last_updated_date from t_order t1 INNER JOIN t_user t2 ON t1.user_num = t2.user_num WHERE t1.user_num = #{userNum}")
    Page<SelectOrderInfoDto> selectOrderInfoPage(Page<SelectOrderInfoDto> pagination, @Param("userNum") String userNum);

}